package com.atguigu.boot.event;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationEvent;

/**
 * XXXX 实体
 *
 * @author lihj
 * @version 1.0.0
 * @title CustomEvent
 * @description <TODO description class purpose>
 * @date 2023/7/11
 */
public class CustomEvent extends ApplicationEvent {

    private static final long serialVersionUID = -7058371859589691525L;
    private Logger logger = LoggerFactory.getLogger(CustomEvent.class);

    private String msg;

    public CustomEvent(Object source,String msg) {
        super(source);
        this.msg = msg;
    }

    public void printMsg(String msg) {
        logger.info("CustomEvent Spring 监听执行：==> printMsg method 自定义事件: {}", msg);
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
